package com.gree.changying.activity.mainactivity.framgent.homefrm;


import android.view.View;

import androidx.recyclerview.widget.LinearLayoutManager;

import com.gree.changying.R;
import com.gree.changying.activity.base.BasePageFragment;
import com.gree.changying.activity.mainactivity.framgent.homefrm.tuijian.adapter.ZxzxAdapter;
import com.gree.changying.activity.mainactivity.framgent.homefrm.tuijian.bean.Zxzx;
import com.gree.changying.view.AutoRecyclerView;

import java.util.ArrayList;
import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;

public class XinwenFrm extends BasePageFragment {
    @Override
    protected void initView(View view) {
        ButterKnife.bind(this,view);
        init();
        initZxzx();
    }

    /**
     * 新闻
     */
    @Bind(R.id.zxzxRv)
    AutoRecyclerView zxzxRv;
    private ZxzxAdapter zxzxAdapter;
    private void initZxzx(){
        zxzxRv.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false) {
            @Override
            public boolean canScrollVertically() {
                return false;
            }
        });
        zxzxRv.setHasFixedSize(true);
        zxzxAdapter = new ZxzxAdapter(R.layout.item_tuijian_zxzx,getZxzx());
        zxzxRv.setAdapter(zxzxAdapter);
    }

    private Object[][] zxzxList = {
            {R.drawable.icon_haibao,"技术的房间山豆根士大夫山豆根士大夫","时间：2021/01/23","NBA"},
            {R.drawable.icon_haibao,"技术的房间山豆根士大夫山豆根士大夫","时间：2021/01/23","NBA"},
            {R.drawable.icon_haibao,"技术的房间山豆根士大夫山豆根士大夫","时间：2021/01/23","NBA"},
            {R.drawable.icon_haibao,"技术的房间山豆根士大夫山豆根士大夫","时间：2021/01/23","NBA"},
            {R.drawable.icon_haibao,"技术的房间山豆根士大夫山豆根士大夫","时间：2021/01/23","NBA"},
            {R.drawable.icon_haibao,"技术的房间山豆根士大夫山豆根士大夫","时间：2021/01/23","NBA"},
            {R.drawable.icon_haibao,"技术的房间山豆根士大夫山豆根士大夫","时间：2021/01/23","NBA"},
            {R.drawable.icon_haibao,"技术的房间山豆根士大夫山豆根士大夫","时间：2021/01/23","NBA"},
            {R.drawable.icon_haibao,"技术的房间山豆根士大夫山豆根士大夫","时间：2021/01/23","NBA"},
            {R.drawable.icon_haibao,"技术的房间山豆根士大夫山豆根士大夫","时间：2021/01/23","NBA"},
            {R.drawable.icon_haibao,"技术的房间山豆根士大夫山豆根士大夫","时间：2021/01/23","NBA"},
            {R.drawable.icon_haibao,"技术的房间山豆根士大夫山豆根士大夫","时间：2021/01/23","NBA"},
            {R.drawable.icon_haibao,"技术的房间山豆根士大夫山豆根士大夫","时间：2021/01/23","NBA"},
            {R.drawable.icon_haibao,"技术的房间山豆根士大夫山豆根士大夫","时间：2021/01/23","NBA"},
            {R.drawable.icon_haibao,"技术的房间山豆根士大夫山豆根士大夫","时间：2021/01/23","NBA"},
            {R.drawable.icon_haibao,"技术的房间山豆根士大夫山豆根士大夫","时间：2021/01/23","NBA"},
            {R.drawable.icon_haibao,"技术的房间山豆根士大夫山豆根士大夫","时间：2021/01/23","NBA"},
            {R.drawable.icon_haibao,"技术的房间山豆根士大夫山豆根士大夫","时间：2021/01/23","NBA"},
            {R.drawable.icon_haibao,"技术的房间山豆根士大夫山豆根士大夫","时间：2021/01/23","NBA"},
            {R.drawable.icon_haibao,"技术的房间山豆根士大夫山豆根士大夫","时间：2021/01/23","NBA"},
            {R.drawable.icon_haibao,"技术的房间山豆根士大夫山豆根士大夫","时间：2021/01/23","NBA"},
            {R.drawable.icon_haibao,"技术的房间山豆根士大夫山豆根士大夫","时间：2021/01/23","NBA"},
            {R.drawable.icon_haibao,"技术的房间山豆根士大夫山豆根士大夫","时间：2021/01/23","NBA"}
    };
    private List<Zxzx> getZxzx(){
        List<Zxzx> rmsses = new ArrayList<>();
        for(Object[] o:zxzxList){
            Zxzx rmss = new Zxzx();
            rmss.setImg((int)o[0]);
            rmss.setTitle((String)o[1]);
            rmss.setTime((String)o[2]);
            rmss.setTag((String)o[3]);
            rmsses.add(rmss);
        }
        return rmsses;
    }



    @Override
    protected int getLayoutId() {
        return R.layout.frm_xinwen;
    }

    private void init(){

    }
}
